package com.example.tg.Service.Impl;

import com.example.tg.Dao.House_orderMapper;
import com.example.tg.Service.House_orderService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.House_order;
import pojo.ListHo;

import java.util.List;

@Service
public class House_orderServiceImpl implements House_orderService  {
    @Autowired
    private House_orderMapper house_orderMapper;


    @Override
    public int addHo(House_order house_order) {
        return house_orderMapper.addHo(house_order);
    }

    @Override
    public int deleHo(String id) {
        return house_orderMapper.deleHo(id);
    }


    @Override
    public PageInfo listHo(ListHo listHo) {
        PageHelper.startPage(listHo.getPageNum(),listHo.getPageSize());
        List<House_order> list=house_orderMapper.listHo(listHo);
        PageInfo<House_order> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public int contHo() {
        return house_orderMapper.contHo();
    }
}
